from flask import Flask
from flask_nameko import FlaskPooledClusterRpcProxy
import config

from app.admin import admin
from app.user import user

rpc = FlaskPooledClusterRpcProxy()


def create_app():
    app = Flask(__name__)
    app.config.from_object('config')
    app.register_blueprint(user)
    app.register_blueprint(admin)
    rpc.init_app(app)
    return app

app = create_app()

from main import views
